import pandas as pd
import plotly.express as px

# 创建一个简单的 DataFrame
data = {
    'Year': [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019],
    'Sales': [200, 240, 310, 370, 410, 450, 510, 620, 700, 780],
    'Profit': [20, 30, 40, 50, 60, 70, 80, 90, 100, 110]  # 假设的利润数据
}
df = pd.DataFrame(data)

# 使用 Plotly Express 绘制三维散点图
fig = px.scatter_3d(df, x='Year', y='Sales', z='Profit', title='年度销售额与利润的三维散点图')

# 显示图表
fig.show()